From f114c47cceebbf8546c7dd1303433f062c82d31b Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Thu, 19 Jul 2012 11:09:39 +0100 Subject: [PATCH] x86/mm/p2m: use NX bit in p2m entries. In p2m_type_to_flags() honor _PAGE_NX_BIT for grant type mappings. This brings this code in line with PV and EPT. Signed-off-by: Christoph Egger Acked-by: Tim Deegan Committed-by: Tim Deegan --- xen/arch/x86/mm/p2m-pt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c index c97cac45c5..2a4a64d51c 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -89,14 +89,16 @@ static unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn) case p2m_ram_paging_in: default: return flags; - case p2m_ram_ro: case p2m_grant_map_ro: + return flags | P2M_BASE_FLAGS | _PAGE_NX_BIT; + case p2m_ram_ro: case p2m_ram_logdirty: case p2m_ram_shared: return flags | P2M_BASE_FLAGS; case p2m_ram_rw: - case p2m_grant_map_rw: return flags | P2M_BASE_FLAGS | _PAGE_RW; + case p2m_grant_map_rw: + return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT; case p2m_mmio_direct: if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) ) flags |= _PAGE_RW; -- 2.30.2